<template>
  <div class="card" :style="{ marginTop }">
    <div class="card__date">{{ date }}</div>
    <div class="card__content">
      <img :src="img" />
      <div class="card__right">
        <div class="card__header">
          <span v-if="isRead" class="card__dot"></span>
          <div class="card__title">{{ title }}</div>
        </div>
        <div class="card__desc van-multi-ellipsis--l2">
          {{ content }}
        </div>
      </div>
    </div>
  </div>
</template>
<script name="card-image" setup>
const props = defineProps({
  img: String,
  isRead: {
    type: Boolean,
    default: true,
  },
  date: String,
  title: String,
  content: String,
  marginTop: {
    type: String,
    default: 0,
  },
});
</script>
<style lang="scss" scoped>
.card {
  &__date {
    font-size: 12px;
    font-family: PingFangSC, PingFang SC;
    font-weight: 400;
    color: #b9bdbd;
    line-height: 17px;
    text-align: center;
    margin-bottom: 16px;
  }
  &__content {
    background-color: #fff;
    border-radius: 4px;
    padding: 14px 16px;
    display: flex;
    img {
      width: 88px;
      height: 68px;
      border-radius: 4px;
    }
  }
  &__right {
    flex: 1;
    padding-left: 10px;
  }
  &__header {
    display: flex;
    align-items: center;
  }
  &__dot {
    width: 6px;
    height: 6px;
    background: #ff6060;
    border-radius: 3px;
    margin: 0 6px;
  }
  &__title {
    font-size: 16px;
    font-family: PingFangSC, PingFang SC;
    font-weight: 500;
    color: #272b2d;
    line-height: 22px;
  }
  &__desc {
    font-size: 14px;
    font-family: PingFangSC, PingFang SC;
    font-weight: 400;
    color: #676b6b;
    line-height: 20px;
  }
}
</style>